<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Carte mère:  Fichier source de src/trames.h</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Généré par Doxygen 1.7.2 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="main.html"><span>Page&#160;principale</span></a></li>
      <li><a href="pages.html"><span>Pages&#160;associées</span></a></li>
      <li><a href="annotated.html"><span>Structures&#160;de&#160;données</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Portée&#160;globale</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>src/trames.h</h1>  </div>
</div>
<div class="contents">
<a href="trames_8h.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**********************************</span>
<a name="l00002"></a>00002 <span class="comment">* trames.h</span>
<a name="l00003"></a>00003 <span class="comment">* définition des différentes trames utilisées dans la communication des drones</span>
<a name="l00004"></a>00004 <span class="comment">* Par Guillaume STRUB (MIQ4) le 2/12/2010</span>
<a name="l00005"></a>00005 <span class="comment">**********************************/</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="preprocessor">#ifndef _TRAMES_H</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span><span class="preprocessor">#define _TRAMES_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">//! Octet de départ d&#39;une trame (carte capteurs ou communication XBee)</span>
<a name="l00011"></a>00011 <span class="comment"></span><span class="comment">/*! Toutes les trames de communication entre les différents modules du projet Drone (excepté l&#39;IMU)</span>
<a name="l00012"></a>00012 <span class="comment">* sont composées d&#39;un octet de départ, d&#39;un octet de type, des données et d&#39;un checksum :</span>
<a name="l00013"></a>00013 <span class="comment">* &lt;&#39;@&#39;&gt; &lt;type&gt; &lt;données...&gt; &lt;checksum&gt;</span>
<a name="l00014"></a>00014 <span class="comment">*  1     1        n            1</span>
<a name="l00015"></a>00015 <span class="comment">* Le checksum est calculé en faisant la somme de tous les octets de la trame (hormis le dernier !)</span>
<a name="l00016"></a>00016 <span class="comment">*/</span>
<a name="l00017"></a><a class="code" href="trames_8h.html#aa34f3db65e8e2285027433f0dec98a0d">00017</a> <span class="preprocessor">#define DEBUT_TRAME                     &#39;@&#39; //Octet de départ trame</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00019"></a>00019 <span class="comment">//! Octet de type d&#39;une trame capteurs</span>
<a name="l00020"></a>00020 <span class="comment"></span><span class="comment">/*! Une telle trame est construite de la façon suivante :</span>
<a name="l00021"></a>00021 <span class="comment">* &lt;&#39;@&#39;&gt; &lt;&#39;#&#39;&gt; &lt;GPSx:4&gt; &lt;GPSy:4&gt; &lt;GPSs:2&gt; &lt;GPSc:2&gt; &lt;Alt:2&gt; &lt;Vit:2&gt; &lt;Jauge:2&gt; &lt;Checksum&gt;</span>
<a name="l00022"></a>00022 <span class="comment">* -&gt; 21 octets</span>
<a name="l00023"></a>00023 <span class="comment">*/</span>
<a name="l00024"></a><a class="code" href="trames_8h.html#aff03fe72d1cd7da38964e02fdc4f7551">00024</a> <span class="preprocessor">#define TYPE_TRAME_CAPTEURS &#39;#&#39;</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="comment">//! Longueur d&#39;une trame capteurs</span>
<a name="l00026"></a><a class="code" href="trames_8h.html#a1872acbf581ad3e734cd5abd2950bdbb">00026</a> <span class="comment"></span><span class="preprocessor">#define LG_TRAME_CAPTEURS       21</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00028"></a>00028 <span class="comment">//! Longueur maximale d&#39;une trame de communication XBee</span>
<a name="l00029"></a><a class="code" href="trames_8h.html#a4ac2f0fe4a7dfc6dce56b5557fc50197">00029</a> <span class="comment"></span><span class="preprocessor">#define LG_MAX_TRAME_XBEE       30</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00031"></a>00031 <span class="comment">//! Octet de type d&#39;une trame télécommande</span>
<a name="l00032"></a>00032 <span class="comment"></span><span class="comment">/*! Une telle trame est construite de la façon suivante :</span>
<a name="l00033"></a>00033 <span class="comment">* &lt;&#39;@&#39;&gt; &lt;&#39;@&#39;&gt; &lt;voie1:1&gt; &lt;voie2:1&gt; &lt;voie3:1&gt; &lt;voie4:1&gt; &lt;voie5:1&gt; &lt;voie6:1&gt; &lt;voie7:1&gt; &lt;Checksum&gt;</span>
<a name="l00034"></a>00034 <span class="comment">* -&gt; 10 octets</span>
<a name="l00035"></a>00035 <span class="comment">*/</span>
<a name="l00036"></a><a class="code" href="trames_8h.html#abdf0638fee09beccc2cc97b885245644">00036</a> <span class="preprocessor">#define TYPE_TRAME_TELECOMMANDE         &#39;@&#39;</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="comment">//! Longueur d&#39;une trame télécommande</span>
<a name="l00038"></a><a class="code" href="trames_8h.html#a0a202a14b2088928483ec60431adca08">00038</a> <span class="comment"></span><span class="preprocessor">#define LG_TRAME_TELECOMMANDE           10</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="comment">/* Erreurs pouvant se produire lors de l&#39;acquisition d&#39;une trame */</span>
<a name="l00041"></a>00041 <span class="comment"></span>
<a name="l00042"></a>00042 <span class="comment">//! Aucune erreur ne s&#39;est produite</span>
<a name="l00043"></a><a class="code" href="trames_8h.html#a3da40c61be2985a1bd7c6782ae158821">00043</a> <span class="comment"></span><span class="preprocessor">#define TRAME_ERR_NOERR 0x00</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="comment">//! Mauvais octet de départ</span>
<a name="l00045"></a><a class="code" href="trames_8h.html#afdc7aa34583f0f7b6631d7b3697b887d">00045</a> <span class="comment"></span><span class="preprocessor">#define TRAME_ERR_DEBUT 0x02</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="comment">//! Type de trame inconnu</span>
<a name="l00047"></a><a class="code" href="trames_8h.html#ac5cdf218f2aacb64525d94990a4ff613">00047</a> <span class="comment"></span><span class="preprocessor">#define TRAME_ERR_TYPE  0x04</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="comment">//! Erreur de checksum</span>
<a name="l00049"></a><a class="code" href="trames_8h.html#a6c564ba45a98da51b76fc1c75185b211">00049</a> <span class="comment"></span><span class="preprocessor">#define TRAME_ERR_CHECK 0x08</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span>
<a name="l00051"></a>00051 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Généré le Wed Jan 5 2011 17:04:29 pour Carte mère par&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
